<template>
  <thead>
    <tr>
      <th><input type="checkbox" v-model="isall" /> <span>全选</span></th>
      <th>名称</th>
      <th>价格</th>
      <th>数量</th>
      <th>总价</th>
      <th>操作</th>
    </tr>
  </thead>
</template>

<script>
export default {
  props: ["arr"],
  computed: {
    isall: {
      get() {
        return this.arr.every((item) => item.checked === true);
      },
      set(val) {
        return this.arr.forEach((item) => (item.checked = val));
      },
    },
  },
};
</script>

<style>
</style>